package nju.bean.meeting.transporter.Request;

import static org.junit.Assert.*;

import java.util.HashMap;

import nju.bean.meeting.data.User;
import nju.bean.meeting.meetingManagement.MainMeetingManager;
import nju.bean.meeting.meetingManagement.MeetingManager;
import nju.bean.meeting.transporter.Feedback.Feedback;
import nju.bean.meeting.transporter.Feedback.JudgeFeedback;

import org.junit.Test;

public class ChangeContextRequestTest {

	@Test
	public void test() {
		
		User raiser = new User();
		raiser.setUserName("nju");
		MainMeetingManager mainMeetingManager = MainMeetingManager.getInstance();
		HashMap<String, Object> meetingMap = 
				mainMeetingManager.newMeeting("testMeeting", 2 , raiser);
		String meetingId = (String) meetingMap.get("mId");
		MeetingManager mm = mainMeetingManager.matchMeeting(meetingId);
		
		ChangeContextRequest request = new ChangeContextRequest(0);
		
		
		request.setManager(mm);
		
		JudgeFeedback fb = (JudgeFeedback) request.deal();
		
		assertTrue(fb.getResult());
	}

}